<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="layout.xhtml">
        <ui:define name="body">
            <script>
                function title() {
                    document.getElementById('admin').className='selected';
                }
                window.onload=title;
            </script>
            <h:form id="incomeCreate" enctype="multipart/form-data">
                <h1 class="title">
                    <a href="#" class="back" onclick="history.go(-1)"/>
                    Caixa
                </h1>
                <p:messages showDetail="true" autoUpdate="true"  /> 
                <div class="row">
                    <div class="twelve columns">
                        <fieldset>
                            <legend> <h4 style="margin:0 0 10px 0">Cadastrar</h4></legend>

                            <p:panel id="dadosBancariosPanel" style="background: none; border: none;" 
                                     styleClass="container_24 clearfix ">

                                <p:outputLabel value="Banco" for="banco" styleClass="grid_2"/>
                                <p:autoComplete id="banco"  value="#{managerContaBancaria.banco}"
                                                required="true" label="Banco"
                                                styleClass="grid_5" 
                                                var="item" forceSelection="true" dropdown="true" 
                                                minQueryLength="3" itemValue="#{item}" itemLabel="#{item.cod.concat(' - ')}#{item.nome}" 
                                                panelStyle="max-height:200px;"  
                                                completeMethod="#{managerContaBancaria.autocompleteBanco}" 
                                                converter="conversorbanco">
                                </p:autoComplete>
                                <div class="clear"/>
                                <p:outputLabel value="Agência" for="agencia" styleClass="grid_2"/>
                                <p:inputText id="agencia" alt="Agência" title="Agência"
                                             label="Agência" required="true" styleClass="grid_5"
                                             value="#{managerContaBancaria.contaBancaria.agencia}"/>
                                <p:outputLabel value="Conta" for="conta" styleClass="grid_2"/>
                                <p:inputText id="conta" label="Conta"  required="true" styleClass="grid_5"
                                             value="#{managerContaBancaria.contaBancaria.conta}"/>
                                <p:outputLabel value="Operação" for="operacao" styleClass="grid_2"/>
                                <p:inputText id="operacao" label="Operação" styleClass="grid_5"
                                             value="#{managerContaBancaria.contaBancaria.operacao}"/>
                                <div class="clear"/>
                                <p:selectBooleanCheckbox value="#{managerContaBancaria.contaBancaria.contaFluxo}"
                                                         styleClass="grid_20" itemLabel="Conta utilizada para fechamento de caixa diário ?" />  
                                
                                <div class="clear"/>
                                <div class="buttonAction">
                                    <p:commandButton value="Salvar" icon="ui-icon-disk" process="@form"
                                                     update="@form" styleClass="ui-priority-primary"
                                                     actionListener="#{managerContaBancaria.salvar()}" />
                                </div>
                            </p:panel>
                        </fieldset>
                    </div>
                </div>
            </h:form>
        </ui:define>
    </ui:composition>

</html>

